<?php

use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreateServerManagersTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('server_managers', function (Blueprint $table) {
            $table->increments('id');
            $table->string('name')->default('')->comment('名称');
            $table->string('ip')->default('')->nullable()->comment('IP');
            $table->string('configuration')->default('')->nullable()->comment('配置');
            $table->tinyInteger('run_state')->index()->default('1')->comment('状态，1运行中，0 停止运行');
            $table->tinyInteger('pay_type')->default('1')->comment('付费方式，1 包年包月，0按量付费');
            $table->timestamp('expire')->nullable()->comment('到期时间');
            $table->string('platform')->nullable()->comment('所属平台');
            $table->string('platform_account')->nullable()->comment('平台账号');
            $table->tinyInteger('show')->index()->default('1')->comment('是否显示');
            $table->timestamps();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('server_managers');
    }
}
